# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.APIGateway.V1.Model.ApigatewayGateway do
  @moduledoc """
  A Gateway is an API-aware HTTP proxy. It performs API-Method and/or API-Consumer specific actions based on an API Config such as authentication, policy enforcement, and backend selection.

  ## Attributes

  *   `apiConfig` (*type:* `String.t`, *default:* `nil`) - Required. Resource name of the API Config for this Gateway. Format: projects/{project}/locations/global/apis/{api}/configs/{apiConfig}
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Created time.
  *   `defaultHostname` (*type:* `String.t`, *default:* `nil`) - Output only. The default API Gateway host name of the form `{gateway_id}-{hash}.{region_code}.gateway.dev`.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Optional. Display name.
  *   `labels` (*type:* `map()`, *default:* `nil`) - Optional. Resource labels to represent user-provided metadata. Refer to cloud documentation on labels for more details. https://cloud.google.com/compute/docs/labeling-resources
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Resource name of the Gateway. Format: projects/{project}/locations/{location}/gateways/{gateway}
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. The current state of the Gateway.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Updated time.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :apiConfig => String.t() | nil,
          :createTime => DateTime.t() | nil,
          :defaultHostname => String.t() | nil,
          :displayName => String.t() | nil,
          :labels => map() | nil,
          :name => String.t() | nil,
          :state => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:apiConfig)
  field(:createTime, as: DateTime)
  field(:defaultHostname)
  field(:displayName)
  field(:labels, type: :map)
  field(:name)
  field(:state)
  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.APIGateway.V1.Model.ApigatewayGateway do
  def decode(value, options) do
    GoogleApi.APIGateway.V1.Model.ApigatewayGateway.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.APIGateway.V1.Model.ApigatewayGateway do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
